package common;

import java.awt.Button;
import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import button.ActionButton;
import button.LineButton;

public class ButtonClickListener implements MouseListener{
	private Button button;
	public ButtonClickListener(Button b){
		button=b;
	}
	public void mouseClicked(MouseEvent e) {
		if(Common.getButtonClick()!=null){
			Button b=Common.getButtonClick();
			if(b instanceof LineButton){
				LineButton lb=(LineButton)b;
				lb.clear();
				Common.setButtonClick(lb);
			}
		}
		if(e.getModifiers()==InputEvent.BUTTON1_MASK){
			Common.setButtonClick(button);
		}
	}

	public void mousePressed(MouseEvent e) {
	}

	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	public void mouseEntered(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	public void mouseExited(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

}
